import React, { memo } from 'react';
import { renderRoutes } from 'react-router-config';

import { dicoverMenu } from '@/common/local-data';
import { NavLink } from 'react-router-dom';
// import request from '@/netWork/request'

import { DiscoverWrapper, TopMenu } from './style'
const Discover = memo((props) => {
    const { route } = props;
    return (
       <DiscoverWrapper>
           <div className="top">
               <TopMenu className="wrap-v1">
                   {
                       dicoverMenu.map((item,index)=>{
                           return (
                               <div className="item" key={item.title}>
                                   <NavLink to={item.link}>{item.title}</NavLink>
                               </div>
                           )
                       })
                   }
               </TopMenu>
           </div>
        {/* 当你通过renderRoutes渲染路由时会在这个组件里的props中存储route */}
         { renderRoutes(route.routes) }
       </DiscoverWrapper>
    );
});

export default Discover;